import { ref } from 'vue';

type Notify = {
  show?: boolean;
  msg: string;
  title: string;
  onConfirm?: () => any;
  onCancle?: () => any;
};
const rawConfig: Notify = {
  show: false,
  msg: '',
  title: '',
};
export const notifyConfig = ref<Notify>({ ...rawConfig });
export const notify = (config: Notify) => {
  notifyConfig.value = config;
  notifyConfig.value.show = true;
};
export const resetNotify = () => {
  notifyConfig.value = { ...rawConfig };
};
